﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Collaboris Ltd." file="CollaborisPropertyAttribute.cs">
//   Copyright (c) Collaboris Ltd. All rights Reserved.
// </copyright>
// <summary>
//   Defines an Entity Property Attribute.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Collaboris.SharePoint.Wss.Attributes
{
    using System;

    [AttributeUsage(AttributeTargets.Property)]
    public class CollaborisPropertyAttribute : Attribute
    {
        #region Constants and Fields

        private string example;

        private InputHint inputHint;

        private string readMore;

        private bool readOnly;

        private string remarks;

        private bool renderAsExpression;

        private bool required;

        private string serializedExample;

        private string summary = string.Empty;

        private string title = string.Empty;

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets the example.
        /// </summary>
        /// <value>The example.</value>
        public string Example
        {
            get
            {
                return this.example;
            }
            set
            {
                this.example = value;
            }
        }

        /// <summary>
        /// Gets or sets the input hint.
        /// </summary>
        /// <value>The input hint.</value>
        public InputHint InputHint
        {
            get
            {
                return this.inputHint;
            }
            set
            {
                this.inputHint = value;
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether [output property].
        /// </summary>
        /// <value><c>true</c> if [output property]; otherwise, <c>false</c>.</value>
        public bool OutputProperty
        {
            get
            {
                return this.readOnly;
            }
            set
            {
                this.readOnly = value;
            }
        }

        /// <summary>
        /// Gets or sets the read more.
        /// </summary>
        /// <value>The read more.</value>
        public string ReadMore
        {
            get
            {
                return this.readMore;
            }
            set
            {
                this.readMore = value;
            }
        }

        /// <summary>
        /// Gets or sets the remarks.
        /// </summary>
        /// <value>The remarks.</value>
        public string Remarks
        {
            get
            {
                return this.remarks;
            }
            set
            {
                this.remarks = value;
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether [render as expression].
        /// </summary>
        /// <value><c>true</c> if [render as expression]; otherwise, <c>false</c>.</value>
        public bool RenderAsExpression
        {
            get
            {
                return this.renderAsExpression;
            }
            set
            {
                this.renderAsExpression = value;
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether this <see cref="CollaborisPropertyAttribute"/> is required.
        /// </summary>
        /// <value><c>true</c> if required; otherwise, <c>false</c>.</value>
        public bool Required
        {
            get
            {
                return this.required;
            }
            set
            {
                this.required = value;
            }
        }

        /// <summary>
        /// Gets or sets the serialized example.
        /// </summary>
        /// <value>The serialized example.</value>
        public string SerializedExample
        {
            get
            {
                return this.serializedExample;
            }
            set
            {
                this.serializedExample = value;
            }
        }

        /// <summary>
        /// Description about the Entity.
        /// </summary>
        public string Summary
        {
            get
            {
                return this.summary;
            }
            set
            {
                this.summary = value;
            }
        }

        /// <summary>
        /// Friendly Name of the Property.
        /// </summary>
        public string Title
        {
            get
            {
                return this.title;
            }
            set
            {
                this.title = value;
            }
        }

        #endregion
    }

    /// <summary>
    /// 
    /// </summary>
    public enum InputHint
    {
        /// <summary>
        /// 
        /// </summary>
        Input,
        /// <summary>
        /// 
        /// </summary>
        TextArea,
        /// <summary>
        /// 
        /// </summary>
        Date,
        /// <summary>
        /// 
        /// </summary>
        Time,
        /// <summary>
        /// 
        /// </summary>
        Boolean,
        /// <summary>
        /// 
        /// </summary>
        StringCollection,
        /// <summary>
        /// 
        /// </summary>
        Guid,
        /// <summary>
        /// 
        /// </summary>
        Url,
        /// <summary>
        /// 
        /// </summary>
        SingleText,
        /// <summary>
        /// 
        /// </summary>
        Enum,
        /// <summary>
        /// 
        /// </summary>
        ObjectCollection,
        /// <summary>
        /// 
        /// </summary>
        FileUrl,
        Number,
        NullableBoolean,
        LocalDirectory,
        NullableEnum,
        NullableNumber,
        DataSet
    }
}